from django.shortcuts import render

# Create your views here.
from django.contrib.auth.hashers import make_password,check_password
from rest_framework.views import APIView
from rest_framework.response import Response
from .ser import *
from utils.comm import *
import random
class UserAPIView(APIView):
    def get(self,request):
        mobile = request.GET.get('mobile')
        yzm = random.randint(100000,999999)
        me = send_message(mobile,yzm,1)
        conn = get_redis_connection()
        conn.setex('d4zy',30,me)
        if me:
            return Response({'cods':200})
        else:

            return Response({'cods':10010})
